package com.loren.demo04.delay_message;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
public class RedissonDelayQueueController {

    private final RedissonDelayQueue redissonDelayQueue;

    @GetMapping("/task")
    public String addTask(@RequestParam("message") String message, @RequestParam("second") Long second) {
        this.redissonDelayQueue.offerTask(message, second);
        return "success";
    }

}